// 每日背景js


//获取背景对象
var imgs = document.getElementById('imgbg');

var UserCline = document.documentElement.clientHeight;
// 唯美函数
function Beautiful() {
    $.post("/img/parseImage", {queryWord: "唯美"}, function (data) {
        imgs.style.background = 'url(' + data + ') no-repeat';
        imgs.style.backgroundSize = '100% ' + UserCline+ 'px';
        imgs.style.backgroundPositionX = 'center';
        imgs.style.backgroundPositionY = '0';
        // storage['bgPreference'] = data;
    })
}


//可爱
function Cute() {
    $.post("/img/parseImage", {queryWord: "可爱"}, function (data) {
        imgs.style.background = 'url(' + data + ') no-repeat';
        imgs.style.backgroundSize = '100% ' + UserCline + 'px';
        imgs.style.backgroundPositionX = 'center';
        imgs.style.backgroundPositionY = '0';
        // storage['bgPreference'] = data;

    })
}

//萌宠
function Pets() {
    $.post("/img/parseImage", {queryWord: "萌宠"}, function (data) {
        imgs.style.background = 'url(' + data + ') no-repeat';
        imgs.style.backgroundSize = '100% ' + UserCline + 'px';
        imgs.style.backgroundPositionX = 'center';
        imgs.style.backgroundPositionY = '0';
        // storage['bgPreference'] = data;

    })
}

// 简约
function simple() {
    $.post("/img/parseImage", {queryWord: "简约"}, function (data) {
        imgs.style.background = 'url(' + data + ') no-repeat';
        imgs.style.backgroundSize = '100% ' + UserCline + 'px';
        imgs.style.backgroundPositionX = 'center';
        imgs.style.backgroundPositionY = '0';
        // storage['bgPreference'] = data;

    })
}

// 壁纸
function wallpaper() {
    $.post("/img/parseImage", {queryWord: "壁纸"}, function (data) {
        imgs.style.background = 'url(' + data + ') no-repeat';
        imgs.style.backgroundSize = '100% ' + UserCline + 'px';
        imgs.style.backgroundPositionX = 'center';
        imgs.style.backgroundPositionY = '0';
        // storage['bgPreference'] = data;

    })
}

// 二次元
function quadratic() {
    $.post("/img/parseImage", {queryWord: "二次元壁纸"}, function (data) {
        imgs.style.background = 'url(' + data + ') no-repeat';
        imgs.style.backgroundSize = '100% ' + UserCline + 'px';
        imgs.style.backgroundPositionX = 'center';
        imgs.style.backgroundPositionY = '0';
        // storage['bgPreference'] = data;

    })
}